package uba.ing2.subite.domain;

import java.util.Date;

public class Credit extends AbstractAccountEntry {
	private static final String INITIAL_BALANCE_DESCRIPTION = "Deposito inicial";

	public Credit(Date date, Number value, String description) {
		super(date, value, description);
	}

	public static AbstractAccountEntry ofInitialBalance(Date date, Number value) {
		return new Credit(date, value, INITIAL_BALANCE_DESCRIPTION);
	}

	@Override
	public Number affectBalance(Number balance) {
		return balance.doubleValue() + value().doubleValue();
	}

}
